home *** CD-ROM | disk | FTP | other *** search
/ Sky at Night 2007 June / SAN CD 6-2007 CD-ROM 25.iso / pc / Software / AstroGrav_Win / Java / jre1.6.0 / lib / rt.jar / sun / font / TextSourceLabel.class (.txt) < prev    next >
Encoding:
Java Class File  |  2006-11-29  |  3.1 KB  |  126 lines

  1. package sun.font;
  2.  
  3. import java.awt.Font;
  4. import java.awt.Graphics2D;
  5. import java.awt.Rectangle;
  6. import java.awt.Shape;
  7. import java.awt.font.FontRenderContext;
  8. import java.awt.font.GlyphVector;
  9. import java.awt.geom.AffineTransform;
  10. import java.awt.geom.Rectangle2D;
  11.  
  12. public class TextSourceLabel extends TextLabel {
  13.    TextSource source;
  14.    // $FF: renamed from: lb java.awt.geom.Rectangle2D
  15.    Rectangle2D field_0;
  16.    // $FF: renamed from: ab java.awt.geom.Rectangle2D
  17.    Rectangle2D field_1;
  18.    // $FF: renamed from: vb java.awt.geom.Rectangle2D
  19.    Rectangle2D field_2;
  20.    // $FF: renamed from: ib java.awt.geom.Rectangle2D
  21.    Rectangle2D field_3;
  22.    // $FF: renamed from: gv java.awt.font.GlyphVector
  23.    GlyphVector field_4;
  24.  
  25.    public TextSourceLabel(TextSource var1) {
  26.       this(var1, (Rectangle2D)null, (Rectangle2D)null, (GlyphVector)null);
  27.    }
  28.  
  29.    public TextSourceLabel(TextSource var1, Rectangle2D var2, Rectangle2D var3, GlyphVector var4) {
  30.       this.source = var1;
  31.       this.field_0 = var2;
  32.       this.field_1 = var3;
  33.       this.field_4 = var4;
  34.    }
  35.  
  36.    public TextSource getSource() {
  37.       return this.source;
  38.    }
  39.  
  40.    public final Rectangle2D getLogicalBounds(float var1, float var2) {
  41.       if (this.field_0 == null) {
  42.          this.field_0 = this.createLogicalBounds();
  43.       }
  44.  
  45.       return new Rectangle2D.Float((float)(this.field_0.getX() + (double)var1), (float)(this.field_0.getY() + (double)var2), (float)this.field_0.getWidth(), (float)this.field_0.getHeight());
  46.    }
  47.  
  48.    public final Rectangle2D getVisualBounds(float var1, float var2) {
  49.       if (this.field_2 == null) {
  50.          this.field_2 = this.createVisualBounds();
  51.       }
  52.  
  53.       return new Rectangle2D.Float((float)(this.field_2.getX() + (double)var1), (float)(this.field_2.getY() + (double)var2), (float)this.field_2.getWidth(), (float)this.field_2.getHeight());
  54.    }
  55.  
  56.    public final Rectangle2D getAlignBounds(float var1, float var2) {
  57.       if (this.field_1 == null) {
  58.          this.field_1 = this.createAlignBounds();
  59.       }
  60.  
  61.       return new Rectangle2D.Float((float)(this.field_1.getX() + (double)var1), (float)(this.field_1.getY() + (double)var2), (float)this.field_1.getWidth(), (float)this.field_1.getHeight());
  62.    }
  63.  
  64.    public Rectangle2D getItalicBounds(float var1, float var2) {
  65.       if (this.field_3 == null) {
  66.          this.field_3 = this.createItalicBounds();
  67.       }
  68.  
  69.       return new Rectangle2D.Float((float)(this.field_3.getX() + (double)var1), (float)(this.field_3.getY() + (double)var2), (float)this.field_3.getWidth(), (float)this.field_3.getHeight());
  70.    }
  71.  
  72.    public Rectangle getPixelBounds(FontRenderContext var1, float var2, float var3) {
  73.       return this.getGV().getPixelBounds(var1, var2, var3);
  74.    }
  75.  
  76.    public AffineTransform getBaselineTransform() {
  77.       Font var1 = this.source.getFont();
  78.       return var1.hasLayoutAttributes() ? AttributeValues.getBaselineTransform(var1.getAttributes()) : null;
  79.    }
  80.  
  81.    public Shape getOutline(float var1, float var2) {
  82.       return this.getGV().getOutline(var1, var2);
  83.    }
  84.  
  85.    public void draw(Graphics2D var1, float var2, float var3) {
  86.       var1.drawGlyphVector(this.getGV(), var2, var3);
  87.    }
  88.  
  89.    protected Rectangle2D createLogicalBounds() {
  90.       return this.getGV().getLogicalBounds();
  91.    }
  92.  
  93.    protected Rectangle2D createVisualBounds() {
  94.       return this.getGV().getVisualBounds();
  95.    }
  96.  
  97.    protected Rectangle2D createItalicBounds() {
  98.       return this.getGV().getLogicalBounds();
  99.    }
  100.  
  101.    protected Rectangle2D createAlignBounds() {
  102.       return this.createLogicalBounds();
  103.    }
  104.  
  105.    private final GlyphVector getGV() {
  106.       if (this.field_4 == null) {
  107.          this.field_4 = this.createGV();
  108.       }
  109.  
  110.       return this.field_4;
  111.    }
  112.  
  113.    protected GlyphVector createGV() {
  114.       Font var1 = this.source.getFont();
  115.       FontRenderContext var2 = this.source.getFRC();
  116.       int var3 = this.source.getLayoutFlags();
  117.       char[] var4 = this.source.getChars();
  118.       int var5 = this.source.getStart();
  119.       int var6 = this.source.getLength();
  120.       GlyphLayout var7 = GlyphLayout.get((GlyphLayout.LayoutEngineFactory)null);
  121.       StandardGlyphVector var8 = var7.layout(var1, var2, var4, var5, var6, var3, (StandardGlyphVector)null);
  122.       GlyphLayout.done(var7);
  123.       return var8;
  124.    }
  125. }
  126.